<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::FisherLDA Class Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="classshark_1_1_fisher_l_d_a.html">FisherLDA</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classshark_1_1_fisher_l_d_a-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle"><div class="title">shark::FisherLDA Class Reference<div class="ingroups"><a class="el" href="group__supervised__trainer.html">Supervised Trainers</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Fisher's Linear Discriminant Analysis for data compression.  
 <a href="classshark_1_1_fisher_l_d_a.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_fisher_l_d_a_8h_source.html">shark/Algorithms/Trainers/FisherLDA.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for shark::FisherLDA:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classshark_1_1_fisher_l_d_a__inherit__graph.png" border="0" usemap="#ashark_1_1_fisher_l_d_a_inherit__map" alt="Inheritance graph"/></div>
<map name="ashark_1_1_fisher_l_d_a_inherit__map" id="ashark_1_1_fisher_l_d_a_inherit__map">
<area shape="rect" title="Fisher&#39;s Linear Discriminant Analysis for data compression." alt="" coords="48,94,172,120"/>
<area shape="rect" href="classshark_1_1_abstract_trainer.html" title=" " alt="" coords="5,5,215,46"/>
<area shape="poly" title=" " alt="" coords="113,62,113,93,107,93,107,62"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab4c3b1ab384d843edbac48ad473b269f" id="r_ab4c3b1ab384d843edbac48ad473b269f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#ab4c3b1ab384d843edbac48ad473b269f">FisherLDA</a> (bool <a class="el" href="classshark_1_1_fisher_l_d_a.html#a1c26c9088f95cd2c16993da0181d2d09">whitening</a>=false, std::size_t subspaceDimension=0)</td></tr>
<tr class="memdesc:ab4c3b1ab384d843edbac48ad473b269f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <br /></td></tr>
<tr class="separator:ab4c3b1ab384d843edbac48ad473b269f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:affb0188e86c275c85a6ebd6f154ff0e2" id="r_affb0188e86c275c85a6ebd6f154ff0e2"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#affb0188e86c275c85a6ebd6f154ff0e2">name</a> () const</td></tr>
<tr class="memdesc:affb0188e86c275c85a6ebd6f154ff0e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">From <a class="el" href="classshark_1_1_i_nameable.html" title="This class is an interface for all objects which can have a name.">INameable</a>: return the class name.  <br /></td></tr>
<tr class="separator:affb0188e86c275c85a6ebd6f154ff0e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8f8c3a891ece6c53cf53cf14c99bc67" id="r_af8f8c3a891ece6c53cf53cf14c99bc67"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#af8f8c3a891ece6c53cf53cf14c99bc67">setSubspaceDimensions</a> (std::size_t dimensions)</td></tr>
<tr class="separator:af8f8c3a891ece6c53cf53cf14c99bc67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1813d2f5726649dc33a4e212ded2072e" id="r_a1813d2f5726649dc33a4e212ded2072e"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#a1813d2f5726649dc33a4e212ded2072e">subspaceDimensions</a> () const</td></tr>
<tr class="separator:a1813d2f5726649dc33a4e212ded2072e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c26c9088f95cd2c16993da0181d2d09" id="r_a1c26c9088f95cd2c16993da0181d2d09"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#a1c26c9088f95cd2c16993da0181d2d09">whitening</a> () const</td></tr>
<tr class="memdesc:a1c26c9088f95cd2c16993da0181d2d09"><td class="mdescLeft">&#160;</td><td class="mdescRight">check whether whitening mode is on  <br /></td></tr>
<tr class="separator:a1c26c9088f95cd2c16993da0181d2d09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41aad94f4745de9e508b634d6d70a3c4" id="r_a41aad94f4745de9e508b634d6d70a3c4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#a41aad94f4745de9e508b634d6d70a3c4">setWhitening</a> (bool newWhitening)</td></tr>
<tr class="memdesc:a41aad94f4745de9e508b634d6d70a3c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">if active, the model whitenes the inputs  <br /></td></tr>
<tr class="separator:a41aad94f4745de9e508b634d6d70a3c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3bc8d880446350e815a79d63ef95053" id="r_ad3bc8d880446350e815a79d63ef95053"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#ad3bc8d880446350e815a79d63ef95053">train</a> (<a class="el" href="classshark_1_1_linear_model.html">LinearModel</a>&lt;&gt; &amp;model, <a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; RealVector, unsigned int &gt; const &amp;dataset)</td></tr>
<tr class="memdesc:ad3bc8d880446350e815a79d63ef95053"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the <a class="el" href="classshark_1_1_fisher_l_d_a.html" title="Fisher&#39;s Linear Discriminant Analysis for data compression.">FisherLDA</a> solution for a multi-class problem.  <br /></td></tr>
<tr class="separator:ad3bc8d880446350e815a79d63ef95053"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classshark_1_1_abstract_trainer"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classshark_1_1_abstract_trainer')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classshark_1_1_abstract_trainer.html">shark::AbstractTrainer&lt; LinearModel&lt;&gt;, unsigned int &gt;</a></td></tr>
<tr class="memitem:a71d3fd2567473d746ecb733d7fa28c7e inherit pub_methods_classshark_1_1_abstract_trainer" id="r_a71d3fd2567473d746ecb733d7fa28c7e"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_trainer.html#a71d3fd2567473d746ecb733d7fa28c7e">train</a> (<a class="el" href="classshark_1_1_abstract_trainer.html#a0d5c9d35b614d6a33e4e8bfeaf1e9298">ModelType</a> &amp;model, <a class="el" href="classshark_1_1_abstract_trainer.html#aa4730fe9d59622d35d95cd4233f8d7af">DatasetType</a> const &amp;dataset)=0</td></tr>
<tr class="memdesc:a71d3fd2567473d746ecb733d7fa28c7e inherit pub_methods_classshark_1_1_abstract_trainer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Core of the Trainer interface.  <br /></td></tr>
<tr class="separator:a71d3fd2567473d746ecb733d7fa28c7e inherit pub_methods_classshark_1_1_abstract_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classshark_1_1_i_nameable"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classshark_1_1_i_nameable')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classshark_1_1_i_nameable.html">shark::INameable</a></td></tr>
<tr class="memitem:a877dbdfc6b58ea836495143cea44a98c inherit pub_methods_classshark_1_1_i_nameable" id="r_a877dbdfc6b58ea836495143cea44a98c"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_nameable.html#a877dbdfc6b58ea836495143cea44a98c">~INameable</a> ()</td></tr>
<tr class="separator:a877dbdfc6b58ea836495143cea44a98c inherit pub_methods_classshark_1_1_i_nameable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classshark_1_1_i_serializable"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classshark_1_1_i_serializable')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classshark_1_1_i_serializable.html">shark::ISerializable</a></td></tr>
<tr class="memitem:a7baa9ce108d7278822297ce15882782a inherit pub_methods_classshark_1_1_i_serializable" id="r_a7baa9ce108d7278822297ce15882782a"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#a7baa9ce108d7278822297ce15882782a">~ISerializable</a> ()</td></tr>
<tr class="memdesc:a7baa9ce108d7278822297ce15882782a inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Virtual d'tor.  <br /></td></tr>
<tr class="separator:a7baa9ce108d7278822297ce15882782a inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4ad9a7c274deff642f91e98417fbc63 inherit pub_methods_classshark_1_1_i_serializable" id="r_ad4ad9a7c274deff642f91e98417fbc63"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#ad4ad9a7c274deff642f91e98417fbc63">read</a> (<a class="el" href="namespaceshark.html#ada68729491840669e47c8ad42282424f">InArchive</a> &amp;archive)</td></tr>
<tr class="memdesc:ad4ad9a7c274deff642f91e98417fbc63 inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the component from the supplied archive.  <br /></td></tr>
<tr class="separator:ad4ad9a7c274deff642f91e98417fbc63 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bddedd42933c922e323b73131f62f12 inherit pub_methods_classshark_1_1_i_serializable" id="r_a9bddedd42933c922e323b73131f62f12"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#a9bddedd42933c922e323b73131f62f12">write</a> (<a class="el" href="namespaceshark.html#af4f8eb8e9618f5236b71bbcb12b8a524">OutArchive</a> &amp;archive) const</td></tr>
<tr class="memdesc:a9bddedd42933c922e323b73131f62f12 inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the component to the supplied archive.  <br /></td></tr>
<tr class="separator:a9bddedd42933c922e323b73131f62f12 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abdda0c5b8e065b8afbac2cba8f58e841 inherit pub_methods_classshark_1_1_i_serializable" id="r_abdda0c5b8e065b8afbac2cba8f58e841"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#abdda0c5b8e065b8afbac2cba8f58e841">load</a> (<a class="el" href="namespaceshark.html#ada68729491840669e47c8ad42282424f">InArchive</a> &amp;archive, unsigned int version)</td></tr>
<tr class="memdesc:abdda0c5b8e065b8afbac2cba8f58e841 inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Versioned loading of components, calls read(...).  <br /></td></tr>
<tr class="separator:abdda0c5b8e065b8afbac2cba8f58e841 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bf66fa8db15cc529bec98976a2f5255 inherit pub_methods_classshark_1_1_i_serializable" id="r_a5bf66fa8db15cc529bec98976a2f5255"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#a5bf66fa8db15cc529bec98976a2f5255">save</a> (<a class="el" href="namespaceshark.html#af4f8eb8e9618f5236b71bbcb12b8a524">OutArchive</a> &amp;archive, unsigned int version) const</td></tr>
<tr class="memdesc:a5bf66fa8db15cc529bec98976a2f5255 inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Versioned storing of components, calls write(...).  <br /></td></tr>
<tr class="separator:a5bf66fa8db15cc529bec98976a2f5255 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4560a94e8f4908fe8627e41e7d965735 inherit pub_methods_classshark_1_1_i_serializable" id="r_a4560a94e8f4908fe8627e41e7d965735"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#a4560a94e8f4908fe8627e41e7d965735">BOOST_SERIALIZATION_SPLIT_MEMBER</a> ()</td></tr>
<tr class="separator:a4560a94e8f4908fe8627e41e7d965735 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ab5f3eb6ed8d527290ef15fb3579c90ec" id="r_ab5f3eb6ed8d527290ef15fb3579c90ec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#ab5f3eb6ed8d527290ef15fb3579c90ec">meanAndScatter</a> (<a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; RealVector, unsigned int &gt; const &amp;dataset, RealVector &amp;<a class="el" href="namespaceshark.html#a6ae694efca57e84792fcff090223437e">mean</a>, RealMatrix &amp;scatter)</td></tr>
<tr class="separator:ab5f3eb6ed8d527290ef15fb3579c90ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-attribs" name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a51c21f980e6c7fba606824aa032ac914" id="r_a51c21f980e6c7fba606824aa032ac914"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#a51c21f980e6c7fba606824aa032ac914">m_whitening</a></td></tr>
<tr class="separator:a51c21f980e6c7fba606824aa032ac914"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a45e7b8a37cb5c2a64f411e82667d0fb6" id="r_a45e7b8a37cb5c2a64f411e82667d0fb6"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_fisher_l_d_a.html#a45e7b8a37cb5c2a64f411e82667d0fb6">m_subspaceDimensions</a></td></tr>
<tr class="separator:a45e7b8a37cb5c2a64f411e82667d0fb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_types_classshark_1_1_abstract_trainer"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classshark_1_1_abstract_trainer')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classshark_1_1_abstract_trainer.html">shark::AbstractTrainer&lt; LinearModel&lt;&gt;, unsigned int &gt;</a></td></tr>
<tr class="memitem:a0d5c9d35b614d6a33e4e8bfeaf1e9298 inherit pub_types_classshark_1_1_abstract_trainer" id="r_a0d5c9d35b614d6a33e4e8bfeaf1e9298"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_linear_model.html">LinearModel</a>&lt;&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_trainer.html#a0d5c9d35b614d6a33e4e8bfeaf1e9298">ModelType</a></td></tr>
<tr class="separator:a0d5c9d35b614d6a33e4e8bfeaf1e9298 inherit pub_types_classshark_1_1_abstract_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cfa7cdd27b8bb162e64188095f8fa71 inherit pub_types_classshark_1_1_abstract_trainer" id="r_a0cfa7cdd27b8bb162e64188095f8fa71"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_abstract_model.html#a714e85d7a6cd2b68898cb5dbb25c37d4">ModelType::InputType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_trainer.html#a0cfa7cdd27b8bb162e64188095f8fa71">InputType</a></td></tr>
<tr class="separator:a0cfa7cdd27b8bb162e64188095f8fa71 inherit pub_types_classshark_1_1_abstract_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4e344106831fb8227c2120681588ea9 inherit pub_types_classshark_1_1_abstract_trainer" id="r_aa4e344106831fb8227c2120681588ea9"><td class="memItemLeft" align="right" valign="top">typedef unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_trainer.html#aa4e344106831fb8227c2120681588ea9">LabelType</a></td></tr>
<tr class="separator:aa4e344106831fb8227c2120681588ea9 inherit pub_types_classshark_1_1_abstract_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4730fe9d59622d35d95cd4233f8d7af inherit pub_types_classshark_1_1_abstract_trainer" id="r_aa4730fe9d59622d35d95cd4233f8d7af"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; <a class="el" href="classshark_1_1_abstract_trainer.html#a0cfa7cdd27b8bb162e64188095f8fa71">InputType</a>, <a class="el" href="classshark_1_1_abstract_trainer.html#aa4e344106831fb8227c2120681588ea9">LabelType</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_trainer.html#aa4730fe9d59622d35d95cd4233f8d7af">DatasetType</a></td></tr>
<tr class="separator:aa4730fe9d59622d35d95cd4233f8d7af inherit pub_types_classshark_1_1_abstract_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Fisher's Linear Discriminant Analysis for data compression. </p>
<p>Similar to <a class="el" href="classshark_1_1_p_c_a.html" title="Principal Component Analysis.">PCA</a>, <em>Fisher's</em> <em>Linear</em> <em>Discriminant</em> <em>Analysis</em> is a method for reducing the datas dimensionality. In contrast to <a class="el" href="classshark_1_1_p_c_a.html" title="Principal Component Analysis.">PCA</a> it also uses class information.</p>
<p>Consider the data's covariance matrix \( S \) and a unit vector \( u \) which defines a one-dimensional subspace of the data. Then, <a class="el" href="classshark_1_1_p_c_a.html" title="Principal Component Analysis.">PCA</a> would maximmize the objective \( J(u) = u^T S u \), namely the datas variance in the subspace. Fisher-LDA, however, maximizes  </p><p class="formulaDsp">
\[
  J(u) = ( u^T S_W u )^{-1} ( u^T S_B u ),
\]
</p>
<p> where \( S_B \) is the covariance matrix of the class-means and \( S_W \) is the average covariance matrix of all classes (in both cases, each class' influence is weighted by it's size). As a result, Fisher-LDA finds a subspace in which the class means are wide-spread while (in average) the variance of each class becomes small. This leads to good lower-dimensional representations of the data in cases where the classes are linearly separable.</p>
<p>If a subspace with more than one dimension is requested, the above step is executed consecutively to find the next optimal subspace-dimension orthogonally to the others.</p>
<p><b>Note:</b> the max. dimensionality for the subspace is #NumOfClasses-1.</p>
<p>It is possible to choose how many dimnsions are used by setting the appropriate value by calling setSubspaceDImension or in the constructor. Also optionally whitening can be applied. For more detailed information about Fisher-LDA, see <em>Bishop</em>, <em>Pattern</em> <em>Recognition</em> <em>and</em> <em>Machine</em> <em>Learning</em>. </p>

<p class="definition">Definition at line <a class="el" href="_fisher_l_d_a_8h_source.html#l00078">78</a> of file <a class="el" href="_fisher_l_d_a_8h_source.html">FisherLDA.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ab4c3b1ab384d843edbac48ad473b269f" name="ab4c3b1ab384d843edbac48ad473b269f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab4c3b1ab384d843edbac48ad473b269f">&#9670;&#160;</a></span>FisherLDA()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> shark::FisherLDA::FisherLDA </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>whitening</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>subspaceDimension</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ab5f3eb6ed8d527290ef15fb3579c90ec" name="ab5f3eb6ed8d527290ef15fb3579c90ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5f3eb6ed8d527290ef15fb3579c90ec">&#9670;&#160;</a></span>meanAndScatter()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> void shark::FisherLDA::meanAndScatter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; RealVector, unsigned int &gt; const &amp;&#160;</td>
          <td class="paramname"><em>dataset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">RealVector &amp;&#160;</td>
          <td class="paramname"><em>mean</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">RealMatrix &amp;&#160;</td>
          <td class="paramname"><em>scatter</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="affb0188e86c275c85a6ebd6f154ff0e2" name="affb0188e86c275c85a6ebd6f154ff0e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#affb0188e86c275c85a6ebd6f154ff0e2">&#9670;&#160;</a></span>name()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string shark::FisherLDA::name </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>From <a class="el" href="classshark_1_1_i_nameable.html" title="This class is an interface for all objects which can have a name.">INameable</a>: return the class name. </p>

<p>Reimplemented from <a class="el" href="classshark_1_1_i_nameable.html#a9893f99314de30cd472e649c235d0db4">shark::INameable</a>.</p>

<p class="definition">Definition at line <a class="el" href="_fisher_l_d_a_8h_source.html#l00085">85</a> of file <a class="el" href="_fisher_l_d_a_8h_source.html">FisherLDA.h</a>.</p>

</div>
</div>
<a id="af8f8c3a891ece6c53cf53cf14c99bc67" name="af8f8c3a891ece6c53cf53cf14c99bc67"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af8f8c3a891ece6c53cf53cf14c99bc67">&#9670;&#160;</a></span>setSubspaceDimensions()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::FisherLDA::setSubspaceDimensions </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>dimensions</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_fisher_l_d_a_8h_source.html#l00088">88</a> of file <a class="el" href="_fisher_l_d_a_8h_source.html">FisherLDA.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_fisher_l_d_a.html#a45e7b8a37cb5c2a64f411e82667d0fb6">m_subspaceDimensions</a>.</p>

</div>
</div>
<a id="a41aad94f4745de9e508b634d6d70a3c4" name="a41aad94f4745de9e508b634d6d70a3c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a41aad94f4745de9e508b634d6d70a3c4">&#9670;&#160;</a></span>setWhitening()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::FisherLDA::setWhitening </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>newWhitening</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>if active, the model whitenes the inputs </p>

<p class="definition">Definition at line <a class="el" href="_fisher_l_d_a_8h_source.html#l00102">102</a> of file <a class="el" href="_fisher_l_d_a_8h_source.html">FisherLDA.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_fisher_l_d_a.html#a51c21f980e6c7fba606824aa032ac914">m_whitening</a>.</p>

</div>
</div>
<a id="a1813d2f5726649dc33a4e212ded2072e" name="a1813d2f5726649dc33a4e212ded2072e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1813d2f5726649dc33a4e212ded2072e">&#9670;&#160;</a></span>subspaceDimensions()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t shark::FisherLDA::subspaceDimensions </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_fisher_l_d_a_8h_source.html#l00092">92</a> of file <a class="el" href="_fisher_l_d_a_8h_source.html">FisherLDA.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_fisher_l_d_a.html#a45e7b8a37cb5c2a64f411e82667d0fb6">m_subspaceDimensions</a>.</p>

</div>
</div>
<a id="ad3bc8d880446350e815a79d63ef95053" name="ad3bc8d880446350e815a79d63ef95053"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3bc8d880446350e815a79d63ef95053">&#9670;&#160;</a></span>train()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> void shark::FisherLDA::train </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_linear_model.html">LinearModel</a>&lt;&gt; &amp;&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; RealVector, unsigned int &gt; const &amp;&#160;</td>
          <td class="paramname"><em>dataset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compute the <a class="el" href="classshark_1_1_fisher_l_d_a.html" title="Fisher&#39;s Linear Discriminant Analysis for data compression.">FisherLDA</a> solution for a multi-class problem. </p>

</div>
</div>
<a id="a1c26c9088f95cd2c16993da0181d2d09" name="a1c26c9088f95cd2c16993da0181d2d09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c26c9088f95cd2c16993da0181d2d09">&#9670;&#160;</a></span>whitening()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool shark::FisherLDA::whitening </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>check whether whitening mode is on </p>

<p class="definition">Definition at line <a class="el" href="_fisher_l_d_a_8h_source.html#l00097">97</a> of file <a class="el" href="_fisher_l_d_a_8h_source.html">FisherLDA.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_fisher_l_d_a.html#a51c21f980e6c7fba606824aa032ac914">m_whitening</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a45e7b8a37cb5c2a64f411e82667d0fb6" name="a45e7b8a37cb5c2a64f411e82667d0fb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a45e7b8a37cb5c2a64f411e82667d0fb6">&#9670;&#160;</a></span>m_subspaceDimensions</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t shark::FisherLDA::m_subspaceDimensions</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_fisher_l_d_a_8h_source.html#l00112">112</a> of file <a class="el" href="_fisher_l_d_a_8h_source.html">FisherLDA.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_fisher_l_d_a.html#af8f8c3a891ece6c53cf53cf14c99bc67">setSubspaceDimensions()</a>, and <a class="el" href="classshark_1_1_fisher_l_d_a.html#a1813d2f5726649dc33a4e212ded2072e">subspaceDimensions()</a>.</p>

</div>
</div>
<a id="a51c21f980e6c7fba606824aa032ac914" name="a51c21f980e6c7fba606824aa032ac914"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51c21f980e6c7fba606824aa032ac914">&#9670;&#160;</a></span>m_whitening</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool shark::FisherLDA::m_whitening</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_fisher_l_d_a_8h_source.html#l00111">111</a> of file <a class="el" href="_fisher_l_d_a_8h_source.html">FisherLDA.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_fisher_l_d_a.html#a41aad94f4745de9e508b634d6d70a3c4">setWhitening()</a>, and <a class="el" href="classshark_1_1_fisher_l_d_a.html#a1c26c9088f95cd2c16993da0181d2d09">whitening()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/shark/Algorithms/Trainers/<a class="el" href="_fisher_l_d_a_8h_source.html">FisherLDA.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
